<?php use_helper('jQuery')?>

<?php if($sf_user->hasCredential('Crear elemento')): ?>
    <?php foreach($element_types as $element_type): ?>
        <?php if($element_type->getType() != 'Form' || $section->getType()->getType() != 'Register'): ?>
            <div style="margin-left: 5px; margin-top: 5px;">
                <?php echo jq_link_to_remote( $element_type,
                    array(
                        'update' => 'main',
                        'url'    => url_for('element/new?type_id='.$element_type->getId().'&section_id='.$section->getId()),
                        'before' => '$("#main").empty();showLoaderMain();',
                        'complete' => 'hideLoader();',
                        'script' => true
                ))?>
            </div>
        <?php endif; ?>
    <?php endforeach;?>
<?php endif; ?>
